/*
 * cudanHostMemory.h
 *
 *  Created on: Dec 9, 2009
 *      Author: daniel
 */

#ifndef CUDANHOSTMEMORY_H_
#define CUDANHOSTMEMORY_H_

#include "cudanBaseMemory.h"

namespace CUDAN
{
template<typename T, int D = 1>
	class HostMemory : public BaseMemory<T,D>
	{
	public:
		HostMemory();
		HostMemory(T*, DimensionSizeVector&);
		HostMemory(HostMemory<T,D>*);
		HostMemory(DeviceMemory<T,D>*);
		HostMemory<T,D>* operator=(HostMemory<T,D>*);
		HostMemory<T,D>* operator=(DeviceMemory<T,D>*);
		virtual ~HostMemory();

	public:
		virtual void freeMemory();
		virtual void freeMemoryShallow();
		virtual void print();
		virtual void print(DimensionSizeVector&);
		virtual bool allocateMemory(DimensionSizeVector&);
		virtual bool copyFrom(T*, DimensionSizeVector&);
		virtual bool copyFrom(HostMemory<T,D>*);
		virtual bool copyFrom(DeviceMemory<T,D>*);
		virtual bool copyFromShallow(T*, DimensionSizeVector&);
		virtual bool copyFromShallow(HostMemory<T,D>*);
		virtual bool copyTo(T*, DimensionSizeVector&);
		virtual bool copyTo(HostMemory<T,D>*);
		virtual bool copyTo(DeviceMemory<T,D>*);
	};
}

#include "cudanHostMemory.cpp"

#endif /* CUDAFWHOSTMEMORY_H_ */
